 use OlympusSoftware
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GlobalizeGetLanguages]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[GlobalizeGetLanguages]
GO
CREATE PROCEDURE [dbo].[GlobalizeGetLanguages]
	@IdSite int
as
begin
	select distinct gl.* 
	from [dbo].[GlobalizeLanguages] gl inner Join [dbo].[GlobalizeInfoLanguages] gil
	on gl.IdLanguage = gil.FK_IdLanguage
	where FK_IdSite = @IdSite
end
GO

GRANT EXECUTE ON [dbo].[GlobalizeGetLanguages] to [OLYMPUS\ASPNET]


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GlobalizeGetText]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[GlobalizeGetText]
GO
CREATE PROCEDURE [dbo].[GlobalizeGetText]
	@IdSite int,
	@IdPage int,
	@IdInfo int,
	@IdLanguage int
as
begin
	select [TextInfo]
	from [dbo].[GlobalizeInfoLanguages]
	where FK_IdSite = @IdSite and FK_IdPage = @IdPage and IdInfo=@IdInfo and FK_IdLanguage = @IdLanguage
end
GO
GRANT EXECUTE ON [dbo].[GlobalizeGetText] to [OLYMPUS\ASPNET]